﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using ReportFlat.bussiness;
using ReportFlat.DataAccess;
using ReportFlat.Common;
using System.Collections.Generic;
using System.Net;
using System.Drawing;

namespace ReportFlat.Web
{
    public partial class serTest : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public void a1()
        {
            /*
           //string url = "http://baofen.lvkafei.cn/hufen/fans.php?page=";
           string url = "http://rm.ngbbs.com/hufen/fans.php?page=";
           string r = "";
           int i = 1;
           DAOAssist daoAssist =null;
           try
           {
               while(true){
                   daoAssist = new DAOAssist();
                   daoAssist.BeginTransaction();
                   r = Tools.GetPage(url+i);
                   Dictionary<string, object> dict = ReportFlat.Common.JSONHelper.ToDictionary(r);
                   if (dict["sta"].ToString() == "ok")
                   {
                       ArrayList l = (ArrayList)dict["flist"];
                       foreach (Dictionary<string, object> row in l)
                       {
                           try
                           {
                               wx_user vip = new wx_user();
                               vip.FIndustry = "";
                               vip.FCity = row["city"].ToString();
                               vip.FHeadimgurl = row["headimg"].ToString();
                               vip.FQrcode = "http://rm.ngbbs.com/hufen/" + row["qrcode"].ToString();
                               vip.FRemark = row["remark"].ToString();
                               vip.FName = row["username"].ToString();
                               //vip.FWxCode = row["wxid"].ToString();
                               daoAssist.Save(vip);

                           }
                           catch (Exception ex)
                           {
                               //Response.Write(ex);
                           }
                       }
                   }
                   else
                   {
                       break;
                   }
                   i++;
                   daoAssist.Commit();
               }
           }
           catch (Exception ex)
           {
               daoAssist.Rollback();
               Response.Write(ex);
           }
           Response.Write("finish");
            * */
        }
    }
}
